package cn.lvji.springboot.learn1;

import static org.slf4j.LoggerFactory.getLogger;

import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 启动类
 *
 * @author zhouzx
 */
@SpringBootApplication
public class Learn1Application {

    public static void main(String[] args) {
        SpringApplication.run(Learn1Application.class, args);
    }
}


@RestController
class ScenicController {

    private static final Logger logger = getLogger(ScenicController.class);

    @GetMapping("/")
    public String index(HttpServletRequest request){
        String ip = IpUtils.getIpAddress(request);
        logger.info("request is coming from {}.................................",ip);
        return "Hello World!";
    }

}
